<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
function getimages(id)
{
	$.post("/magento/ajaxbutton", {"op": "getimages","id":id},
	  function(data){
		  if(data)
		  {
				$("#newtip_info"+id).html("<img src="+data.small_image+">");  
			}
	   },"json");
}
function closenettip(id)
{
	$("#newtip_info"+id).html('');
}

function batchchangData()
{
	var html="";
	 var str = selectallpro();
	  if (str != false) {
		$.post("/ebayProduct/ajaxbutton?op=showEditProducts", {"op": "showEditProducts","id":str},
		  function(data){ 
				$("#endorderlistst").html(data);
				$('#endorderform').modal('show');	
			
		   },"text");
	 }
			
}

function shippingChange(){
	var html="";
	 var str = selectallpro();
	  if (str != false) {
		$.post("/ebayProduct/ajaxbutton?op=showEditShipingFee", {"op": "showEditShipingFee","id":str},
		  function(data){ 
				$("#shipping_fee_box").html(data);
				$('#shipping_fee_box').modal('show');	
			
		   },"text");
	 }
}

function AWSsubmitst(f,t)
{
	//$('#'+t).modal('hide');
	//AWS.ajax_post($('#'+f));
	$("#"+f).submit();
}

</script>

<title>Ebay店铺在线商品列表</title>
<body class="withvernav">
<div class="bodywrapper">
{{include file='/public/leftmenu.tpl'}}
<div class="centercontent">
  <div class="pageheader notab">
    <h1 class="pagetitle">Ebay店铺在线商品列表</h1>
    <span class="pagedesc"> </span>
        <div class="menulist">
        <ul class="profile_summary">
           <li> <a href="/ebayProduct/ajaxbutton?op=reviseOnlineProduct" target="_blank"><span>库存调整更新至平台</span></a></li>
           <li><a href="/EbayProduct/downOnLineProductList?shopid=286" target="_blank"><span>下载最新平台商品</span></a></li>
         </ul>
      </div>
  </div>
  <!--pageheader-->
  <div id="contentwrapper" class="contentwrapper">
    <div id="basicform" class="subcontent"> 
    	<div style="float:left">  &nbsp;&nbsp; 
		<button class="stdbtn btn_red" onClick="batchchangData()">修改售价与库存</button>&nbsp;&nbsp;<button class="stdbtn btn_red" onClick="shippingChange()">批量修改运费/发货地..</button>&nbsp;
        <a href="/EbayProduct/addNewProduct" class="stdbtn  btn_red"><span>上架新商品</span></a> 
      </div>
      <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
    </div>
    <form class="stdform stdform2" method="get" id="search" action="/ebayProduct/productlist">
      <div class="tableoptions">
       
      
        <select name="webname">
              <option value="">-店铺名-</option>
              {{foreach from=$webname item=li key=key}}
                <option value="{{$li.webname}}" {{if $webnamevalue==$li.webname}} selected{{/if}}>
                    {{$li.webname}}
                </option>
              {{/foreach}}
          </select>
       
        
      
       
       <span style="display:none">操作时间
        <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
        -
        <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /></span>
      关键词
        :
        <input type="text" name="kw" id="kw" class="width200" value="{{$kw}}" placeholder="关键词" />
        &nbsp;
        <button class="btn btn-primary" id="searchbtn">Search</button>
        <input type='hidden' name='if_csv' id='if_csv'>
        <input type='hidden' name='isow' id='isow'>
        <input type='hidden' name='isno' id='isno'>
        <input type='hidden' name='que' id='que'>
      </div>
    </form>
    <!--搜索栏结束-->
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
    <thead>
        <tr class="lbbt">
          <td  bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
          <td  bgcolor="#FEFFF1">店铺</td>
          <td bgcolor="#FEFFF1">商品编号</td>
          <td  bgcolor="#FEFFF1">图片</td>
          <td  bgcolor="#FEFFF1">商品名称</td>
          <td  bgcolor="#FEFFF1">线上状态</td>
          <td  bgcolor="#FEFFF1">在线数量</td>
          <td bgcolor="#FEFFF1">售价</td>
          <td bgcolor="#FEFFF1" >发货方式</td>
          <td  bgcolor="#FEFFF1">运费</td>
          <td  bgcolor="#FEFFF1">多件附加运费</td>
          <td bgcolor="#FEFFF1" >处理时间</td>
          <td bgcolor="#FEFFF1" >状态</td>
          <td bgcolor="#FEFFF1" >查看</td>
        </tr>
      </thead>
      {{foreach from=$productlist item=li key=key}}
      <tr>
        <td ><input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.id}}" /></td>
        <td valign="middle" style="position:relative;">{{$li.webname}}</td>
        <td valign="middle" style="position:relative;"><a href="/product/productlist?other={{$li.sku}}" target="_blank"><font color="#6666FF">{{$li.sku}}</font></a></td>
       
        <td style="position:relative;">{{if $li.base_image}}<a href="{{$li.base_image}}" target="_blank"><img src="{{$li.base_image}}" alt="" width="50"></a>{{/if}}</td>
        <td valign="middle"><span title="{{$li.name}}">{{$li.name|getstr:24:0}}</span></td>
        <td style="position:relative;">{{if $li.is_open =='Active'}}在售{{/if}}
        {{if $li.is_open =='Ended'}}停售{{/if}}{{if $li.is_open =='Completed'}}下架{{/if}}</td>
        <td style="position:relative;">{{$li.quantity}}</td>
        <td style="position:relative;">{{$li.price}}({{$li['currency']}})</td>
        <td valign="middle"><span title="{{$li.ship_types}}">{{$li.ship_types|getstr:10:0}}</span></td>
        <td>{{$li.shipping_fee}}
          <input name="max_ship_day[]" id="orderid{$li['sku']}" class="width100" type="text" style="display:none" value="{{$li['max_ship_day']}}" /></td>
        <td>{{$li.shipping_more_fee}}
          <input name="max_ship_day[]" id="orderid{$li['sku']}" class="width100" type="text" style="display:none" value="{{$li['max_ship_day']}}" /></td>
        <td valign="middle">{{$li.max_ship_day}}天</td>
        <td valign="middle">{{if $li.isupload =='0'}}待更新{{/if}}{{if $li.isupload =='1'}}完成{{/if}}</td>
        <td valign="middle">
        	<a href="{{$li.product_url}}" target="_blank">查看</a>        </td>
      </tr>
      {{/foreach}}
    </table>
    <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
  </div>
</div>


<!-- 模态框（Modal）批量标完成 -->
<div class="modal fade" id="shipping_fee_box" tabindex="-1" role="dialog" aria-labelledby="sendorderform" aria-hidden="true">
    ajax box
</div>

  
<!-- 模态框（Modal）批量标完成 -->
<form action="/ebayProduct/ajaxbutton?op=saveReviseProduct"  method="post" name="batchendorderST" id="batchendorderST">
  <div class="modal fade" id="endorderform" tabindex="-1" role="dialog" aria-labelledby="sendorderform" aria-hidden="true">
    <div class="modal-dialog" style="width:80%;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="sendorderform">修改售价与库存</h4>
        </div>
        <div class="modal-body">
          <span id="errshowsku"></span>
               <div style="width:100%;height:400px; overflow-y:scroll; border:0px solid;" id="endorderlistst">&nbsp;预留 
               </div>
          <div class="modal-footer">
            <button type="button" class="btn btn-primary"  onclick="AWSsubmitst('batchendorderST','endorderform')">提交更新</button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
  <!-- /.modal -->
  </form>


</body>
</html>